package com.zhentao.controller;

import com.zhentao.service.SkService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @Date 2024/4/9 10:43
 * @Author xdm
 **/
@RestController
@RequestMapping("/sk")
@Slf4j
public class SkController {


    @Autowired
    private SkService skService;

    @RequestMapping("/t2")
    public String t2() {
        int i = 1 / 0;
        return "模拟异常";
    }

    @RequestMapping("/t1")
    public String t1() {

        skService.testTrace();

        log.info("这是一个测试慢查询的日志");

        //a的值是xxx,b的值是xxx
        log.info("a的值是{},b的值是{}", "aVal", "bVal");


        try {
            Thread.sleep(1000);

        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        //   int i=1/0;
        System.out.println("测试慢查询");
        return "测试慢查询";
    }
}
